import os
import unittest


class MyTestcase03(unittest.TestCase):
    def test01(self):
        print('test01')

    def test02(self):
        print('test02')


class MyTestcase04(unittest.TestCase):
    def test03(self):
        print('test03')

    def test04(self):
        print('test04')


if __name__ == '__main__':
    suite = unittest.TestSuite()
    loader = unittest.TestLoader()
# 加载测试用例类
    # suite.addTest(loader.loadTestsFromTestCase(MyTestcase03))
    # suite.addTest(loader.loadTestsFromTestCase(MyTestcase04))
# 加载测试用例模板
    # suite.addTest(loader.loadTestsFromModule(MyTestcase03))
    # suite.addTest(loader.loadTestsFromModule(MyTestcase04))
# 加载路径
    path = os.path.dirname(os.path.abspath(__file__))
    suite.addTest(loader.discover(path))

    runner = unittest.TextTestRunner()
    runner.run(suite)
